package com.hiwan.system.dao.data;

import java.util.List;

import org.framework.dao.ServiceUtilDao;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.hiwan.system.pojo.DataInfo;
import com.hiwan.system.pojo.DataViewAuth;

@Component
@Service
@Repository
public class DataViewAuthDao extends ServiceUtilDao {
	public static final String SQL_PATH = "com.hiwan.system.mapper.dataapply.";

	/**
	 * 通过申请人编号查询申请数据信息列表
	 * @param applyEmp
	 * @return
	 */
	public List<DataInfo> selectDataApplyInfo(String applyEmp) {
		return getSqlSession().selectList(SQL_PATH+"selectDataApplyInfo",applyEmp);
	}


	/**
	 * 保存数据查看授权信息
	 * @param dataViewAuth
	 * @return
	 */
	public int insertDataViewAuth(DataViewAuth dataViewAuth) {
		return insert("insertDataViewAuth", dataViewAuth);
	}

	/**
	 * 删除数据查看授权信息
	 * @param dataViewAuth
	 * @return
	 */
	public int deleteDataViewAuth(DataViewAuth dataViewAuth){
		return delete("deleteDataViewAuth", dataViewAuth);
	}
	
	/**
	 * 更新数据查看授权信息
	 * @param dataViewAuth
	 * @return
	 */
	public int updateDataViewAuth(DataViewAuth dataViewAuth){
		return update("updateDataViewAuth", dataViewAuth);
	}
	
	/**
	 * 通过业务编号查询数据查看授权列表
	 * @param busiId
	 * @return
	 */
	public List<DataViewAuth> queryDataViewAuthList(String busiId){
		return selectList("selectDataViewAuthList", busiId,DataViewAuth.class);
	}
}
